import { getCookies, setCookies } from '@/utils/cookies'
import { APPLICATION_TOKEN_KEY, COOKIES } from '@/utils/constant'


export function setToken(value: string) {
  const expiresDate = new Date()
  expiresDate.setDate(expiresDate.getTime() + COOKIES.OVERTIME)
  setCookies(APPLICATION_TOKEN_KEY, value, { expires: expiresDate })
}

export function getToken():string|undefined {
  return  getCookies(APPLICATION_TOKEN_KEY)
}